home *** CD-ROM | disk | FTP | other *** search
- stop();
- _global.CHighscore = function(sServerName, sGetHighscoreFile, sSaveHighscoreFile)
- {
- this.sServerName = sServerName;
- this.sGetHighscoreFile = sGetHighscoreFile;
- this.sSaveHighscoreFile = sSaveHighscoreFile;
- this.aNameOfPlayer = new Array();
- this.aPlayerScore = new Array();
- this.iHighscoreLimit = 0;
- this.bHighscorLoaded = false;
- this.sPlayersNameForHighscore = "";
- this.sPlayersEmailForHighscore = "";
- this.sPlayersScoreForHighscore = "";
- this.HighOfHighscore = 0;
- };
- CHighscore.prototype.GetHighscoreFromServer = function(mcObj)
- {
- var URL = this.sServerName + this.sGetHighscoreFile;
- mcObj.loadVariables(URL,"");
- this.SetOnDataEventHandler(mcObj);
- };
- CHighscore.prototype.SetOnDataEventHandler = function(mcObj)
- {
- mcObj.onData = function()
- {
- if(this.bLoadSucces == "false")
- {
- cGameWorldHighscore.bHighscorLoaded = false;
- this.play();
- }
- else
- {
- cGameWorldHighscore.iHighscoreLimit = this.iLengthOfHighscore;
- var i = 0;
- while(i <= cGameWorldHighscore.iHighscoreLimit)
- {
- cGameWorldHighscore.aNameOfPlayer[i] = eval("this.sPlayerName" + i);
- cGameWorldHighscore.aPlayerScore[i] = eval("this.iPlayerScore" + i);
- i++;
- }
- cGameWorldHighscore.bHighscorLoaded = true;
- this.play();
- }
- };
- };
- CHighscore.prototype.DisplayHighscore = function(sLinkageObj, iOffsetValueY, iSwapD, mcObj)
- {
- if(this.cGameWorldHighscore.bHighscorLoaded == true)
- {
- var iStartX = 0;
- var iStartY = 0;
- var iOffsetY = iOffsetValueY;
- var i = 0;
- while(i < this.cGameWorldHighscore.iHighscoreLimit)
- {
- mcObj.attachMovie("oneLineInHighScore","oneLineInHighScore" + i,i + iSwapD);
- var ObjPath = eval("oneLineInHighScore" + i);
- if(i < 9)
- {
- ObjPath.Rank = "00" + (i + 1);
- }
- else if(i >= 9 && i < 99)
- {
- ObjPath.Rank = "0" + (i + 1);
- }
- else if(i = 99)
- {
- ObjPath.Rank = i + 1;
- }
- ObjPath.nameOfPlayer = this.cGameWorldHighscore.aNameOfPlayer[i];
- ObjPath.Point = this.cGameWorldHighscore.aPlayerScore[i];
- ObjPath._x = iStartX;
- ObjPath._y = iStartY + i * iOffsetY;
- i++;
- }
- this.cGameWorldHighscore.HighOfHighscore = i * iOffsetY;
- }
- };
- CHighscore.prototype.SaveHighscore = function(mcObj)
- {
- if(String(this.sPlayersNameForHighscore).length == 0)
- {
- this.sPlayersNameForHighscore = "n/a";
- }
- if(String(this.sPlayersEmailForHighscore).length == 0)
- {
- this.sPlayersEmailForHighscore = "n/a";
- }
- var URL = this.sServerName + this.sSaveHighscoreFile + "?randomNumOfSite=" + cGameWorld.iRandomNumberOfSite + "&sPlayerName=" + this.sPlayersNameForHighscore + "&sPlayerEmail=" + this.sPlayersEmailForHighscore + "&iPlayerScore=" + this.sPlayersScoreForHighscore;
- mcObj.loadVariables(URL,"");
- mcObj.onData = function()
- {
- this.play();
- };
- };
- _global.CTellAFriend = function(sServerName, sTellAFriendFile)
- {
- this.sServerName = sServerName;
- this.sTellAFriendFile = sTellAFriendFile;
- this.sFromName = "";
- this.sFromEmail = "";
- this.sToName = "";
- this.sToEmail = "";
- };
- CTellAFriend.prototype.SendAnEmailToAFriend = function(mcObj)
- {
- var URL = this.sServerName + this.sTellAFriendFile + "?randomNumOfSite=X65rD99j6Kx&sFromMail=" + this.sFromEmail + "&sFromName=" + this.sFromName + "&sToMail=" + this.sToEmail + "&sToName=" + this.sToName + "&iMyPoint=" + cGameWorld.iGameScore;
- trace(URL);
- mcObj.loadVariables(URL,"");
- mcObj.onData = function()
- {
- this.play();
- };
- };
- this.cGameWorldHighscore = new CHighscore("","getHighscore.asp","saveHighScoreToDB.asp");
- this.cGameWorldTell = new CTellAFriend("","tellAFriend.asp");
-